package xyz.xxpc.springcloud.test;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.ServerSocket;
import java.net.Socket;

public class NewServer {

    public static void main(String[] args) throws IOException {
        ServerSocket serverSocket = new ServerSocket(10086);
        int count = 0;
        while (true) {
            // 拿到和客户端的一个连接
            Socket client = serverSocket.accept();
            System.out.println("一个客户端上来了" + count ++);
            (new ClientHandler(client)).start(); // 启用一个线程去处理


        }
        //ERR_INVALID_HTTP_RESPONSE
    }

}
